package com.gxa.meiye.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.gxa.meiye.admin.mapper.UpdateMapper;
import com.gxa.meiye.admin.service.UpdateService;
import com.gxa.meiye.core.pojo.domain.Consumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: zy
 * @CreateTime: 2022-07-21  20:59
 */
@Service
public class UpdateServiceImpl extends ServiceImpl<UpdateMapper, Consumer> implements UpdateService {
    @Autowired
    private UpdateMapper updateMapper;

    @Override
    public Integer selectAddUpdate(String phone, String img, String name) {
        Consumer select = updateMapper.select(phone);
        Integer update=0;
        if (select!=null) {
             update= updateMapper.update(img, name, phone);
        }
        return update;
    }

    @Override
    public Consumer selectImg(String phone) {
        Consumer select = updateMapper.select(phone);
        return select;
    }
}
